package com.note.config.constants;

/**
 * @Package：com.note.user.constants
 * @Name：GateWayConstants
 * @Author：热伊木
 * @Email：uyevan@163.com
 * @Date：2023-12-24-14:31
 * @Description：网关中心常量定义
 */
public class GatewayConstants {
    /*避免绕过网关，每个子模块检测key*/
    public static final String GATEWAY_KEY_NAME = "GatewayKey";
    public static final String GATEWAY_KEY = "wownote!E@W#A$N";
    public static final String INTERNAL_KEY = "wownote!E@NWN";

    /**
     * 全局白名单入口
     * [网关不验证+消费者不验证]
     * 【此路由无需提交Token的接口】<br>
     * This constant is deprecated. Use another approach instead.
     *
     * @Deprecated 已抛弃
     */
    public static final String[] DONT_PATH_PATTERNS = {
            "/user/user/login",
            "/user/user/register",
            "/share/view/*",
            "/note/note/viewShareNote/*"
    };

    /**
     * 全局需验证路由
     * [检验参数中的username]
     * 【此路由必须提交username需要验证用户状态】<br>
     * This constant is deprecated. Use another approach instead.
     *
     * @Deprecated 已抛弃
     */
    public static final String[] ADD_PATH_PATTERNS = {
            "/user/user/info",
            "/note/folder/createFolder",
            "/note/folder/listFolders",
            "/note/folder/deleteFolder",
            "/note/note/recordNote",
            "/note/note/listNotes",
            "/note/note/viewNote",
            "/note/note/removeNote",
            "/note/note/updateNote",
            "/note/minio/upload",
            "/share/share/create",
            "/share/share/shares",
            "/share/share/delete",
            "/share/share/modify"
    };

    /**
     * 应用层放行路由
     * 【配置 {@code @EnableGatewayFilter} 的应用有效】
     */
    public static final String[] SERVER_DONT_PATH_PATTERNS = {
            "/user/internal/fetchUserInfoGateway/*/*", //内部获取用户信息
            "/services/internal/recordUploadNoteFile", //内部文件上传记录
            "/share/internal/deleteShareByNoteIdList", //内部批量删除分享
            //"/test/**", //所有测试类
            //"/druid/**", //Druid数据库连接池控制台
            //Knife4j文档
            //"/doc.html",
            //"/v3/**",
            //"/webjars/**"
    };
}
